﻿using System;
using System.Collections.Generic;
using System.Xml;
using YArchitech.Temp.Properties;

namespace YArchitech.Temp
{
	internal class ColumnInfo
	{
		public string Name { get; set; }

		public string HeaderText { get; set; }

		public int Width { get; set; }

		public bool Visible { get; set; }

		public int Index { get; set; }

		public static List<ColumnInfo> GetColumnInfo()
		{
			List<ColumnInfo> list = new List<ColumnInfo>();
			XmlDocument xmlDocument = new XmlDocument();
			xmlDocument.LoadXml(Resources.PipeSystemTreeGridViewStyle);
			int num = 0;
			foreach (object obj in xmlDocument.SelectSingleNode("HYPipeSystemTreeGridViewStyle").SelectSingleNode("Columns").SelectNodes("Column"))
			{
				XmlNode xmlNode = (XmlNode)obj;
				list.Add(new ColumnInfo
				{
					Name = xmlNode.Attributes["Name"].Value,
					HeaderText = xmlNode.Attributes["Header"].Value,
					Width = int.Parse(xmlNode.Attributes["Width"].Value),
					Visible = (string.Compare(xmlNode.Attributes["Visible"].Value, "true", true) == 0),
					Index = num++
				});
			}
			return list;
		}
	}
}
